<style>
.right_side_operate_area .item_add_btn a{
	margin-top:6px;
	margin-bottom:6px;
}
</style>
<div class="right_side_operate_area">
	<?php  
		if($showpage==1) {
			if(isset($paging)){ echo $this->renderElement('pagination',$paging);}  
		}
	?>
    <?php $currentuser=$session->read('User'); ?>
    	<?php if($currentuser['isadmin']){ ?>
		<div class="right item_add_btn"><?php echo $html->link('添加', 'add');?></div>
	<?php }else{
			echo '<div class="right enableaction">';
			echo "<a>添加</a>";
			echo '</div>';
		}
	 ?>
   
    <div class="clear"></div>
</div>

<div class="right_side_scollbar">
	<div class="detail_info_panel">
		<div class="items_list">
			<table cellpadding='0' cellspacing='0' width='100%'>
				<tr>
					<th><?php __('Notice Title'); ?></th>
		            <th><?php __('Notice Date'); ?></th>
		            <th><?php __('Action'); ?></th>
				</tr>
			<!-- Here is where we loop through our $posts array, printing out post info -->
			<?php foreach($notices as $notice): ?>
				<tr class = "per_list">
					<td style='text-align:left;text-indent:40px;'>
						<?php if(count($notice['Attachment'])>0): ;?>
						<?php echo $html->image('attachment.png',array('align'=>'absmiddle')); ?>
						<?php endif; ?>
						<?php echo $html->link($str->sub_len($notice['Notice']['title'],40),"/notices/view/".$notice['Notice']['id'],array('title'=>$notice['Notice']['title'])) ;?></td>
					<td><?php echo date("Y-m-d",$notice['Notice']['date']); ?></td>
					<td>
						<?php 
							if($currentuser['id'] == $notice['Notice']['id'] || $currentuser['isadmin']){
							echo $html->link(__('Edit',true), array('action' => 'edit', $notice['Notice']['id']), null, null);
							echo $html->link(__('Delete',true), array('action' => 'deletenotice', $notice['Notice']['id']),  array("onclick"=>"return doaction(this)")); 
							}else{
								echo "<span class='enableaction'>编辑</span>";
								echo "<span class='enableaction'>删除</span>";
							}
						?> 
					</td>
				</tr>
			<?php endforeach; ?>
			</table>
		</div> 
	</div>
</div>
<?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>